package com.christina.entity;

import com.baomidou.mybatisplus.annotation.*;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.time.LocalDateTime;

/**
 * 聊天消息实体类
 *
 * @author Christina
 */
@Data
@EqualsAndHashCode(callSuper = false)
@TableName("t_chat_message")
public class ChatMessage {

    /**
     * 主键ID
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    /**
     * 用户ID
     */
    @TableField("user_id")
    private Long userId;

    /**
     * 消息内容
     */
    @TableField("content")
    private String content;

    /**
     * 消息类型 (USER/ASSISTANT)
     */
    @TableField("message_type")
    private String messageType;

    /**
     * 创建时间
     */
    @TableField(value = "create_time", fill = FieldFill.INSERT)
    private LocalDateTime createTime;

    /**
     * 更新时间
     */
    @TableField(value = "update_time", fill = FieldFill.INSERT_UPDATE)
    private LocalDateTime updateTime;

    /**
     * 逻辑删除标识 (0-未删除 1-已删除)
     */
    @TableLogic
    @TableField("is_deleted")
    private Integer isDeleted = 0;
}